package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.AttendanceDataTempAddDTO;
import org.jsola.hr.dto.AttendanceDataTempUpdateDTO;
import org.jsola.hr.query.AttendanceDataTempQuery;
import org.jsola.hr.vo.AttendanceDataAllAndErrorVO;
import org.jsola.hr.vo.AttendanceDataTempListVO;
import org.jsola.hr.vo.AttendanceDataTempVO;
import org.jsola.hr.vo.ParseAttendanceDataTempExcelVO;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import java.util.Date;
import java.util.List;

/**
 * 临时考勤数据
 *
 * @author zhr
 */
@Api(tags = "hr-临时考勤数据")
public interface IAttendanceDataTempControllerAPI {

    /**
     * 根据记录ID考勤记录导入月工资表
     *
     * @param attendanceDataTempQuery 查询
     * @return 导入成功的数量
     */
    @ApiOperation(value = "根据记录ID考勤记录导入月工资表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceDataTempQuery", dataType = "AttendanceDataTempQuery", value = "临时考勤数据查询参数", paramType = "query")
    })
    Result<Integer> importMonthSallary(AttendanceDataTempQuery attendanceDataTempQuery);

    /**
     * 根据记录ID考勤记录导入月工资表 (sa_employee_salary_new)
     *
     * @param attendanceDataTempQuery 查询
     * @return 导入成功的数量
     */
    @ApiOperation(value = "根据记录ID考勤记录导入月工资表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceDataTempQuery", dataType = "AttendanceDataTempQuery", value = "临时考勤数据查询参数", paramType = "body")
    })
    Result<Integer> importMonthSalary(AttendanceDataTempQuery attendanceDataTempQuery);

    /**
     * 导出错误数据通过记录ID(新)
     *
     * @param recordId 记录ID
     * @return 错误数据Excel
     */
    @ApiOperation(value = "导出错误数据通过记录ID(新)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "recordId", dataType = "String", value = "考勤工资记录ID", paramType = "path")
    })
    ResponseEntity<Resource> errorDataExcelByRecordId(String recordId);

    /**
     * 导出错误数据通过记录ID
     *
     * @param recordId 记录ID
     * @return 错误数据Excel
     */
    @ApiOperation(value = "导出错误数据通过记录ID")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "recordId", dataType = "String", value = "考勤工资记录ID", paramType = "path")
    })
    ResponseEntity<Resource> getErrorDataExcel(String recordId);

    /**
     * 获取某条考勤工资信息(新)
     *
     * @param attendanceDataTempId 考勤工资详情ID
     * @return 临时考勤数据展示对象
     */
    @ApiOperation(value = "获取某条考勤工资信息(新)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceDataTempId", dataType = "String", value = "考勤工资详情ID", paramType = "path")
    })
    Result<AttendanceDataTempVO> workHoursInfoById(String attendanceDataTempId);

    /**
     * 获取某条考勤工资信息
     *
     * @param attendanceDataTempId 考勤工资详情ID
     * @return 临时考勤数据展示对象
     */
    @ApiOperation(value = "获取某条考勤工资信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceDataTempId", dataType = "String", value = "考勤工资详情ID", paramType = "path")
    })
    Result<AttendanceDataTempVO> getWorkHoursInfoById(String attendanceDataTempId);

    /**
     * 分页展示某考勤记录的详情(新)
     *
     * @param attendanceDataTempQuery 考勤工资记录ID
     * @return 临时考勤数据展示对象
     */
    @ApiOperation(value = "分页展示某考勤记录的详情(新)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceDataTempQuery", dataType = "AttendanceDataTempQuery", value = "临时考勤数据查询参数", paramType = "query")
    })
    Result<Page<AttendanceDataTempListVO>> attendanceDataInfo(AttendanceDataTempQuery attendanceDataTempQuery);

    /**
     * 分页展示某考勤记录的详情
     *
     * @param attendanceDataTempQuery 考勤工资记录ID
     * @return 临时考勤数据展示对象
     */
    @ApiOperation(value = "分页展示某考勤记录的详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceDataTempQuery", dataType = "AttendanceDataTempQuery", value = "临时考勤数据查询参数", paramType = "query")
    })
    Result<Page<AttendanceDataTempListVO>> getAttendanceDataInfo(AttendanceDataTempQuery attendanceDataTempQuery);

    /**
     * 根据考勤工资记录ID计算相关的工资影响(新)
     *
     * @param recordId 考勤工资记录ID
     * @return 计算成功的数据条数
     */
    @ApiOperation(value = "根据记录ID计算出所有数据的工资影响(新)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "recordId", dataType = "String", value = "考勤工资记录ID", paramType = "path")
    })
    Result<Integer> newCalculateSalary(String recordId);

    /**
     * 根据考勤工资记录ID计算相关的工资影响
     *
     * @param recordId 考勤工资记录ID
     * @return 计算成功的数据条数
     */
    @ApiOperation(value = "根据记录ID计算出所有数据的工资影响")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "recordId", dataType = "String", value = "考勤工资记录ID", paramType = "path")
    })
    Result<Integer> calculateSalary(String recordId);

    /**
     * 处理解析考勤工资表后的错误数据
     *
     * @param attendanceDataTempQuery 临时考勤数据查询参数
     * @return 处理成功条数
     */
    @ApiOperation(value = "处理解析考勤工资表后的错误数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceDataTempQuery", dataType = "AttendanceDataTempQuery", value = "临时考勤数据查询参数", paramType = "query")
    })
    Result<Integer> handleError(AttendanceDataTempQuery attendanceDataTempQuery);

    /**
     * 查询某次导入的考勤工资记录，需要页数详情，模板id，记录ID
     *
     * @param attendanceDataTempQuery 临时考勤数据查询参数
     * @return 某次导入的考勤工资记录
     */
    @ApiOperation(value = "查询某次导入的考勤工资记录(所有和错误)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceDataTempQuery", dataType = "AttendanceDataTempQuery", value = "临时考勤数据查询参数", paramType = "query")
    })
    Result<AttendanceDataAllAndErrorVO> getAttendanceDataTempAllAndError(AttendanceDataTempQuery attendanceDataTempQuery);

    /**
     * 导入excel(新)
     *
     * @param file                    上传的文件
     * @param attendanceDataTempQuery 临时考勤数据查询参数
     * @return 返回解析excel后的数据
     */
    @ApiOperation(value = "导入excel(新)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file",
                    value = "文件，Content-Type需要设置为multipart/form-data",
                    paramType = "form"),
            @ApiImplicitParam(name = "attendanceDataTempQuery", dataType = "AttendanceDataTempQuery", value = "临时考勤数据查询参数", paramType = "form")
    })
    Result<AttendanceDataAllAndErrorVO> newImportFile(MultipartFile file, AttendanceDataTempQuery attendanceDataTempQuery);

    /**
     * 导入excel，需要页数详情，年月，用工单位id，模板id
     *
     * @param file                    上传的文件
     * @param attendanceDataTempQuery 临时考勤数据查询参数
     * @return 返回解析excel后的数据
     */
    @ApiOperation(value = "导入excel")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file",
                    value = "文件，Content-Type需要设置为multipart/form-data",
                    paramType = "form"),
            @ApiImplicitParam(name = "attendanceDataTempQuery", dataType = "AttendanceDataTempQuery", value = "临时考勤数据查询参数", paramType = "form")
    })
    Result<AttendanceDataAllAndErrorVO> importFile(MultipartFile file, AttendanceDataTempQuery attendanceDataTempQuery);

    /**
     * 新增临时考勤数据
     *
     * @param attendanceDataTempAddDTO 临时考勤数据新增实体
     * @return 临时考勤数据展示对象
     */
    @ApiOperation(value = "新增临时考勤数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceDataTempAddDTO", dataType = "AttendanceDataTempAddDTO", value = "新增临时考勤数据", paramType = "body")
    })
    Result<AttendanceDataTempVO> save(AttendanceDataTempAddDTO attendanceDataTempAddDTO);


    /**
     * 修改临时考勤数据
     *
     * @param attendanceDataTempUpdateDTO 临时考勤数据
     * @return 更新数量
     */
    @ApiOperation(value = "修改临时考勤数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceDataTempUpdateDTO", dataType = "AttendanceDataTempUpdateDTO", value = "修改临时考勤数据", paramType = "body")
    })
    Result<Integer> update(AttendanceDataTempUpdateDTO attendanceDataTempUpdateDTO);


    /**
     * 删除单个临时考勤数据，彻底删除
     *
     * @param attendanceDataTempId 临时考勤数据id
     * @return 删除数量
     */
    @ApiOperation(value = "删除单个临时考勤数据，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceDataTempId", dataType = "String", value = "临时考勤数据id", paramType = "path")
    })
    Result<Integer> delete(String attendanceDataTempId);


    /**
     * 批量删除临时考勤数据，彻底删除
     *
     * @param attendanceDataTempIds 临时考勤数据id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除临时考勤数据，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceDataTempIds", dataType = "String[]", value = "临时考勤数据id数组", paramType = "body", allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] attendanceDataTempIds);


    /**
     * 根据临时考勤数据id查询临时考勤数据详情
     *
     * @param attendanceDataTempId 临时考勤数据id
     * @return 临时考勤数据详情
     */
    @ApiOperation(value = "根据临时考勤数据id查询临时考勤数据详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceDataTempId", dataType = "String", value = "临时考勤数据id", paramType = "path")
    })
    Result<AttendanceDataTempVO> findById(String attendanceDataTempId);


    /**
     * 查询临时考勤数据
     *
     * @param attendanceDataTempQuery 临时考勤数据查询参数
     * @return page
     */
    @ApiOperation(value = "查询临时考勤数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceDataTempQuery", dataType = "AttendanceDataTempQuery", value = "临时考勤数据查询参数", paramType = "query")
    })
    Result<List<AttendanceDataTempListVO>> listAll(AttendanceDataTempQuery attendanceDataTempQuery);


    /**
     * 分页查询临时考勤数据
     *
     * @param attendanceDataTempQuery 临时考勤数据查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询临时考勤数据")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "attendanceDataTempQuery", dataType = "AttendanceDataTempQuery", value = "临时考勤数据查询参数", paramType = "query")
    })
    Result<Page<AttendanceDataTempListVO>> page(AttendanceDataTempQuery attendanceDataTempQuery);


}

